<?php

namespace App\Modules\CodeDesigner\ObserveMode\Observe;

// 事件产生类
abstract class EventGenerate
{
    /**
     * 监听者
     * @var array
     */
    private $observes = [];

    public function addObserve(Observe $observe)
    {
        $this->observes[] = $observe;
    }

    public function notice()
    {
        foreach ($this->observes as $observe) {
            call_user_func([$observe, 'update']);
        }
    }
}